﻿<UserControl x:Class="Starehe.Views.ClassSubjectSetup"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:Controls="clr-namespace:Helper.Controls;assembly=Helper"
      mc:Ignorable="d" Background="White"
      d:DesignHeight="700" d:DesignWidth="860">

    <Grid>
        <TextBlock HorizontalAlignment="Left" Margin="20,20,0,0" Style="{DynamicResource Title}"  Text="Classes &amp; Subjects Setup" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="30,75,0,0" Style="{DynamicResource Title0}" Text="Add New Class" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,120,0,0" Text="Name of Class" VerticalAlignment="Top"/>
        <TextBox HorizontalAlignment="Left" Height="23" Margin="126,120,0,0"  VerticalAlignment="Top" Width="200"
                 DataContext="{Binding NewClass}"
                 Text="{Binding NameOfClass, UpdateSourceTrigger=PropertyChanged}"/>
        <Button Content="_Add" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" 
        	Command="{Binding AddNewClassCommand}" Margin="251,170,0,0"/>
        <TextBlock HorizontalAlignment="Left" Margin="350,100,0,0" Style="{DynamicResource Title0}" Text="Registred Classes" VerticalAlignment="Top"/>
        <ListBox Height="157" Margin="350,129,30,0" VerticalAlignment="Top" 
                 ItemsSource="{Binding ClassesSetup.Entries, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                 DisplayMemberPath="NameOfClass"/>
        <TextBlock HorizontalAlignment="Left" Margin="30,290,0,0" Style="{DynamicResource Title0}" Text="Add New Subject" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,399,0,0" TextWrapping="Wrap" Text="Enter the subject name and maximum score" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="84,438,0,0" TextWrapping="Wrap" Text="Name" VerticalAlignment="Top"/>
        <TextBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="200" Margin="126,438,0,0"
                 DataContext="{Binding NewSubject}"
                 Text="{Binding NameOfSubject, UpdateSourceTrigger=PropertyChanged}" />
        <TextBlock HorizontalAlignment="Left" Margin="31,488,0,0" TextWrapping="Wrap" Text="Maximum Score" VerticalAlignment="Top"/>
        <TextBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Margin="126,488,0,0"
                 DataContext="{Binding NewSubject}"
                  Text="{Binding MaximumScore, UpdateSourceTrigger=PropertyChanged}" />
        <TextBlock HorizontalAlignment="Left" Margin="89,342,0,0" TextWrapping="Wrap" Text="Class" VerticalAlignment="Top"/>
        <ComboBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" ItemsSource="{Binding ClassesSetup.Entries}"
        	DisplayMemberPath="NameOfClass"
        	SelectedValuePath="ClassID"
        	SelectedValue="{Binding SelectedClassID, Mode=OneWayToSource}" Margin="126,342,0,0"/>
        <Button Content="_Add" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" 
        	Command="{Binding AddNewSubjectCommand}" Margin="251,538,0,0"/>

        <TextBlock HorizontalAlignment="Left" Margin="350,315,0,0" Style="{DynamicResource Title0}" Text="Registred Subjects" VerticalAlignment="Top"/>
        <ListBox Margin="350,344,30,50" ItemsSource="{Binding SubjectsSetup.Entries, UpdateSourceTrigger=PropertyChanged}"
                 DisplayMemberPath="NameOfSubject"/>




    </Grid>
</UserControl>
